package com.diandian.backend.entrance.client.dto;

import com.diandian.base.boot.starter.exception.DefaultException;

import java.io.Serializable;
import java.util.List;

public class CertificateVerifyParamDTO implements Serializable {

    private String verify_token; // 【必传】一次验券的标识 (用于短时间内的幂等)； 平台券的verify_token由验券准备接口返回； 三方券的verify_token由开发者自生成，多次验券verify_token的值要有变化
    private String poi_id; // 【必传】核销的快手门店id
    private List<String> encrypted_codes; // 验券准备接口返回的加密快手券码
    private List<String> codes; // 三方原始券码值列表 (encrypted_codes/codes/code_with_time_list必须三选一)
    private String order_id; // 【必传】快手订单号
    private List<CertificateVerifyParamCodeWithTime> code_with_time_list; // 带有核销时间的三方码列表 （如果code_with_time_list 和 codes 同时传， 本字段优先级更高）
    private String out_order_id; // 外部订单ID
    private List<String> certificate_ids; // 快手侧的券唯一id 三方码一单一码商品用此核销，一单一码商品核销必传
    private CertificateVerifyParamCodeWithBiz code_with_biz_info; // 一单一码场景，发券回调时若不记录快手券唯一id即certificate_id，核销时则使用此参数

    public void check(){
        if(this.verify_token == null || "".equals(this.verify_token)){
            throw new DefaultException("一次验券的标识不能为空");
        }
        if(this.poi_id == null || "".equals(this.poi_id)){
            throw new DefaultException("核销的快手门店id不能为空");
        }
        if(this.order_id == null || "".equals(this.order_id)){
            throw new DefaultException("快手订单号不能为空");
        }
    }

    public String getVerify_token() {
        return verify_token;
    }

    public void setVerify_token(String verify_token) {
        this.verify_token = verify_token;
    }

    public String getPoi_id() {
        return poi_id;
    }

    public void setPoi_id(String poi_id) {
        this.poi_id = poi_id;
    }

    public List<String> getEncrypted_codes() {
        return encrypted_codes;
    }

    public void setEncrypted_codes(List<String> encrypted_codes) {
        this.encrypted_codes = encrypted_codes;
    }

    public List<String> getCodes() {
        return codes;
    }

    public void setCodes(List<String> codes) {
        this.codes = codes;
    }

    public String getOrder_id() {
        return order_id;
    }

    public void setOrder_id(String order_id) {
        this.order_id = order_id;
    }

    public List<CertificateVerifyParamCodeWithTime> getCode_with_time_list() {
        return code_with_time_list;
    }

    public void setCode_with_time_list(List<CertificateVerifyParamCodeWithTime> code_with_time_list) {
        this.code_with_time_list = code_with_time_list;
    }

    public String getOut_order_id() {
        return out_order_id;
    }

    public void setOut_order_id(String out_order_id) {
        this.out_order_id = out_order_id;
    }

    public List<String> getCertificate_ids() {
        return certificate_ids;
    }

    public void setCertificate_ids(List<String> certificate_ids) {
        this.certificate_ids = certificate_ids;
    }

    public CertificateVerifyParamCodeWithBiz getCode_with_biz_info() {
        return code_with_biz_info;
    }

    public void setCode_with_biz_info(CertificateVerifyParamCodeWithBiz code_with_biz_info) {
        this.code_with_biz_info = code_with_biz_info;
    }
}
